function update() {
    var ajax = Ajax();
    ajax.post("cklogin.php", "flag=1", function (data) {
        console.log('=====1==');
        var myObject = eval('(' + data + ')');
        if (myObject.status == 1) {
            alert(myObject.info);
            window.location.href = "login.php";
        }
        console.log('====2===');
    });
}
console.log('===我来也====');
window.onload = function () {
    var ajax = Ajax();
    ajax.post("cklogin.php", "flag=1", function (data) {
        console.log('=====1==');
        var myObject = eval('(' + data + ')');
        if (myObject.status == 1) {
            alert(myObject.info);
            window.location.href = "login.php";
        }

        console.log('====2===');
    });
    setInterval('update()', 3000);
}
console.log('====我走了====');

function update() {
    var ajax = Ajax();
    ajax.post("cklogin.php", "flag=1", function (data) {
        console.log('=====1==');
        var myObject = eval('(' + data + ')');
        if (myObject.status == 1) {
            alert(myObject.info);
            window.location.href = "login.php";
        }
        console.log('====2===');
    });
}
function update1() {
    var ajax = Ajax();
    ajax.post("update1.php", "flag=1", function (data) {
        var myObject = eval('(' + data + ')');
        console.log(myObject.adminid);
        if (myObject.status == 1) {
            alert('您被管理员封了!请联系客服!');
            window.location.href = "login.php";
        } else {
            $("#adminid1").val(myObject.adminid);
            $("#adminid").val(myObject.adminid);
        }
    });
}
window.onload = function () {
    var ajax = Ajax();
    ajax.post("update1.php", "flag=1", function (data) {
        var myObject = eval('(' + data + ')');
        console.log(myObject.adminid);
        if (myObject.status == 1) {
            alert('您被管理员封了!请联系客服!');
            window.location.href = "login.php";
        } else {
            $("#adminid1").val(myObject.adminid);
            $("#adminid").val(myObject.adminid);
        }
    });
    setInterval('update1()', 3000);
};
function update2() {
    var ajax = Ajax();
    var fid = parseInt($("#fid").val());
    ajax.post("update2.php", 'fid=' + fid, function (data) {
        var kai = data.substr(data.length - 1, 1);
        if (kai == 0) {
            var adminid = $("#adminid").val();
            if (adminid == 14) {
                alert('对不起，管理员关闭游客访问权限');
                window.location.href = "login.php";
            }
        }
    });
}
window.onload = function () {
    var fid = parseInt($("#fid").val());
    var ajax = Ajax();
    ajax.post("update2.php", 'fid=' + fid, function (data) {
        var kai = data.substr(data.length - 1, 1);
        if (kai == 0) {
            var adminid = $("#adminid").val();
            if (adminid == 14) {
                alert('对不起，管理员关闭游客访问权限');
                window.location.href = "login.php";
            }
        }
    });
    setInterval('update2()', 3000);
};

